package com.tallysystem.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.tallysystem.dao.UserDao;
import com.tallysystem.daoimpl.UserDaoImpl;
import com.tallysystem.entity.User;

@WebServlet("/showuser")
public class GetAllUserMessageServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//		String username = request.getParameter("username");
			UserDao userDao = new UserDaoImpl();
			List<User> userMessage = userDao.findUserMessage();
	//		HttpSession session = request.getSession();
			request.setAttribute("usermessage", userMessage);
			request.getRequestDispatcher("getpersonal.jsp").forward(request, response);

		
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		doGet(request, response);
	}

}
